Handling multiple task sequences in a stream processing framework

ABSTRACT

The technology disclosed improves existing streaming processing systems by allowing the ability to both scale up and scale down resources within an infrastructure of a stream processing system. In particular, the technology disclosed relates to a dispatch system for a stream processing system that adapts its behavior according to a computational capacity of the system based on a run-time evaluation. The technical solution includes, during run-time execution of a pipeline, comparing a count of available physical threads against a set number of logically parallel threads. When a count of available physical threads equals or exceeds the number of logically parallel threads, the solution includes concurrently processing the batches at the physical threads. Further, when there are fewer available physical threads than the number of logically parallel threads, the solution includes multiplexing the batches sequentially over the available physical threads.

PRIORITY APPLICATION

This application is related to and claims the benefit of U.S.Provisional Patent Application 62/219,127, “HANDLING MULTIPLE TASKSEQUENCES IN A STREAM PROCESSING FRAMEWORK”, filed on Sep. 16, 2015. Thepriority provisional application is hereby incorporated by reference forall purposes.

RELATED APPLICATIONS

This application is related to U.S. patent application Ser. No.14/936,141, entitled “SIMPLIFIED ENTITY LIFECYCLE MANAGEMENT” filed onNov. 9, 2015. The related application is hereby incorporated byreference for all purposes.

This application is related to U.S. patent application Ser. No.14/931,658, entitled “SIMPLIFIED ENTITY ENGAGEMENT AUTOMATION” filed onNov. 3, 2015. The related application is hereby incorporated byreference for all purposes.

This application is related to U.S. Patent Application No. 14/986,365,“PROVIDING STRONG ORDERING IN MULTI-STAGE STREAMING PROCESSING,” filedon Dec. 31, 2015. The related application is hereby incorporated byreference for all purposes.

FIELD OF THE TECHNOLOGY DISCLOSED

The technology disclosed relates generally to a processing framework forstream processing systems, and in particular to providing an improvedstream processing framework that uses a combination of concurrent andmultiplexed processing.

BACKGROUND

The subject matter discussed in this section should not be assumed to beprior art merely as a result of its mention in this section. Similarly,a problem mentioned in this section or associated with the subjectmatter provided as background should not be assumed to have beenpreviously recognized in the prior art. The subject matter in thissection merely represents different approaches, which in and ofthemselves may also correspond to implementations of the claimedtechnology.

The technology disclosed improves existing streaming processing systemsby providing the ability to both scale up and scale down resourceswithin an infrastructure of a stream processing system. In particular,the technology disclosed relates to a dispatch process for a streamprocessing system that adapts its behavior according to a computationalcapacity of the system based on a run-time evaluation. The technicalsolution includes, during run-time execution of a pipeline, comparing acount of available physical threads against a set number of logicallyparallel threads; and when a count of available physical threads equalsor exceeds the number of logically parallel threads, concurrentlyprocessing the batches at the physical threads. Further, when there arefewer available physical threads than the number of logically parallelthreads, the solution includes multiplexing the batches sequentiallyover the available physical threads.

In today's world, we are dealing with huge data volumes, popularlyreferred to as “Big Data”. Web applications that serve and managemillions of Internet users, such as Facebook™, Instagram™, Twitter™,banking websites, or even online retail shops, such as Amazon.com™ oreBay™ are faced with the challenge of ingesting high volumes of data asfast as possible so that the end users can be provided with a real-timeexperience.

Another major contributor to Big Data is a concept and paradigm called“Internet of Things” (IoT). IoT is about a pervasive presence in theenvironment of a variety of things/objects that through wireless andwired connections are able to interact with each other and cooperatewith other things/objects to create new applications/services. Theseapplications/services are in areas likes smart cities (regions), smartcar and mobility, smart home and assisted living, smart industries,public safety, energy and environmental protection, agriculture andtourism.

Stream processing is quickly becoming a crucial component of Big Dataprocessing solutions for enterprises, with many popular open-sourcestream processing systems available today, including Apache Storm™,Apache Spark™, Apache Samza™ Apache Flink™, and others. Many of thesestream processing solutions offer default schedulers that evenlydistribute processing tasks between the available computation resourcesusing a round-robin strategy. However, such a strategy is not costeffective because substantial computation time and resources are lostduring assignment and re-assignment of tasks to the correct sequence ofcomputation resources in the stream processing system, therebyintroducing significant latency in the system.

Therefore, an opportunity arises to provide systems and methods that usea combination of concurrent and multiplexed processing schemes to adaptto the varying computational requirements and availability in a streamprocessing system with little performance loss or added complexity.Increased revenue, higher user retention, improved user engagement andexperience may result.

SUMMARY

A simplified summary is provided herein to help enable a basic orgeneral understanding of various aspects of exemplary, non-limitingimplementations that follow in the more detailed description and theaccompanying drawings. This summary is not intended, however, as anextensive or exhaustive overview. Instead, the sole purpose of thissummary is to present some concepts related to some exemplarynon-limiting implementations in a simplified form as a prelude to themore detailed description of the various implementations that follow.

The technology disclosed improves existing streaming processing systemsby allowing the ability to both scale up and scale down resources withinan infrastructure of a stream processing system. In particular, thetechnology disclosed relates to a dispatch system for a streamprocessing system that adapts its behavior according to a computationalcapacity of the system based on a run-time evaluation. The technicalsolution includes, during run-time execution of a pipeline, comparing acount of available physical threads against a set number of logicallyparallel threads; and when a count of available physical threads equalsor exceeds the number of logically parallel threads, concurrentlyprocessing the batches at the physical threads. Further, when there arefewer available physical threads than the number of logically parallelthreads, the solutions includes multiplexing the batches sequentiallyover the available physical threads.

Other aspects and advantages of the technology disclosed can be seen onreview of the drawings, the detailed description and the claims, whichfollow.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings, like reference characters generally refer to like partsthroughout the different views. Also, the drawings are not necessarilyto scale, with an emphasis instead generally being placed uponillustrating the principles of the technology disclosed. In thefollowing description, various implementations of the technologydisclosed are described with reference to the following drawings, inwhich:

FIG. 1 depicts an exemplary IoT platform.

FIG. 2 illustrates a stream processing framework used by an IoT platformsimilar to the example IoT platform shown in FIG. 1, according to oneimplementation of the technology disclosed.

FIG. 3 is one implementation of a worker node in a worker tier thatincludes a plurality of physical threads utilizing a whole processorcore of the worker node.

FIG. 4A and FIG. 4B depict one implementation of concurrently processingbatches in a pipeline when a count of available physical threads equalsor exceeds a set number of logically parallel threads.

FIG. 5A, FIG. 5B and FIG. 5C show one implementation of multiplexingbatches in a pipeline sequentially when there are fewer availablephysical threads than a set number of logically parallel threads.

FIG. 6 shows one implementation of a flowchart of handling multiple tasksequences including long tail task sequences on a limited number ofworker nodes of a stream processing system.

FIG. 7 is a block diagram of an exemplary multi-tenant system suitablefor integration with the IoT platform of FIG. 1 in accordance with oneor more implementations of the technology disclosed.

DETAILED DESCRIPTION

The following detailed description is made with reference to thefigures. Sample implementations are described to illustrate thetechnology disclosed, not to limit its scope, which is defined by theclaims. Those of ordinary skill in the art will recognize a variety ofequivalent variations on the description that follows.

The discussion is organized as follows. First, an explanation ofterminology that will be used throughout the discussion is provided,followed by an introduction describing some of the technical problemsaddressed and technical solutions offered by various implementations.Then, a high-level description of some implementations will be discussedat an architectural level. Also, a state machine implementing an entitymanagement workflow is described. Further, some user interface viewsused by some implementations will be presented. Next, more focusedactions for implementing the system, together with data entry models,transitive triggers and condition definitions are discussed. Lastly,some particular implementations are discussed.

Terminology

Task Sequence: A “task sequence” is defined as a designed effort orprocess, usually implemented by an experience operator (e.g. company,organization), to enable effective user management and resourceprovisioning, application life cycle management, workflowimplementation, user engagement, traffic monitoring, activity tracking,provisioning for application modeling, etc. A task sequence involvescollection of data from a large number of entities and subsequentprocessing of the collected data. Data for task sequences is received ascontinuous near real-time (NRT) data streams, which are processed togenerate real-time analytics. In one illustrative example, a tasksequence is a ride delivery workflow set up by a cab sharing companylike Uber™. The ride delivery workflow can involve multiple stages, suchas (1) receiving a cab request from an end-user, (2) identifying therequested destination area, (3) discovering available Uber cab driversin the destination area, (4) transmitting the cab request with contactinformation of the end-user to the available Uber cab drivers, (5)receiving ratification from at least one willing Uber cab driver, (6)notifying the end-user of the imminent cab arrival with cab vehicleinformation and (7) receiving confirmation from the end-user regardingaccepting the cab delivery. Each of these seven stages involves exchangeof a substantial amount of data, which gets processed in real-time togenerate real-time analytics. An augmentation of millions of suchreal-time user-requests and real-time responses applied over extendedperiods of time is defined as a task sequence. Other examples of a tasksequence could be—receiving millions of e-mails every day for an entityoperator like Microsoft™ and processing them in real-time to generateclick metrics that identify which users clicked on certain web linksincluded in the e-mails, receiving millions of requests from users ofUber™ to redeem ride discount coupons distributed by Uber™ and receivingmillions of tweets about a music concert. This applicationinterchangeably refers to a “task sequence” as an “entity experienceoperation”, and vice-versa.

Long Tail Task Sequence: A “long tail task sequence” is a task sequencethat consumes dedicated computing resources which, when properly sizedfor the beginning of the task sequence, are excessive as the tasksequence tails off. An example of a long tail task sequence is thegiving of fantasy football game tokens during a Super Bowl by a gamingcompany. Once the demand for fantasy football tapers after the SuperBowl, the use of the game tokens decreases. As a result, the number ofgame token redemption request events electronically received alsodecreases. However, the gaming company continues to honor the unusedtokens that are redeemed slowly over a long period after the Super Bowl.This extended lull can be characterized by a long tail task sequencebecause it does not require as many computation resources as does thesurge during the Super Bowl and thus token handling can be completedusing fewer computational resources than initially allotted.

Container: A stream processing framework is built using an API(application programming interface) and deployed as a cluster called a“container”. The container takes care of the distribution of tasks/jobswithin a given infrastructure and the API is designed to handle messagepassing, task/job discovery and fault-tolerance. This applicationinterchangeably refers to a “container” as a “stream container”, andvice-versa. This application also interchangeably refers to a“container” or a collection of containers as a “grid”, and vice-versa.

Worker Node: A container groups a set of physical machines called“worker nodes”.

Physical Thread: Once deployed, a container operates over of a set ofso-called “physical threads”. A physical thread utilizes a processorcore of a worker node and runs inside a set of code processes (e.g.,Java processes) that are distributed over the worker node, no more thanone physical thread per core. A physical thread also carries out thelogic of a set of tasks/jobs for different elements and components(e.g., emitters and transformers) of a container.

Emitter: Data enters a container through a so-called “emitter”. Emittersare event tuple sources for a container and are responsible for gettingthe event tuples into the container. In one implementation, emitterspull event tuples from input queues. In some implementations, emittersinclude user-specified conversion functions, such that they consume bytestrings from an input queue and forward them as tuples to downstreamtransformers. An emitter retrieves one or more tasks/jobs to be executedby one or more physical threads of a worker node.

Transformers: A transformer is a computation unit of a container thatprocesses the incoming event tuples in the container and passes them tothe next set of transformers downstream in the container. A transformerpasses one or more tasks/jobs downstream, typically to be furthertransformed one or more physical threads of a worker node.

Pipeline: A pipeline is defined as a series of grouped event tuples fromone or more NRT data streams. In one implementation, the grouping is ontuple-by-type basis. In another implementation, the grouping is onbatch-by-batch basis. In some implementations, each pipeline isidentified by a unique pipeline identifier (ID). In one implementation,multiple NRT data streams can source data to one or more pipelines. Inanother implementation, multiple pipelines can source event tuples toone or more containers. In yet another implementation, a NRT data streamfor a task sequence is assigned to a single pipeline, which in turn isprocessed over a single container. This application interchangeablyrefers to a “pipeline” as an “input pipeline” and vice-versa.

Batch: A batch is defined as an assemblage of event tuples partitionedon a time-slice basis and/or a batch-size basis and sequentially queuedin a pipeline. A time-slice based definition includes partitioning atleast one incoming NRT data stream by its most recently received portionwithin a time window (e.g., one batch keeps the event tuples from thelast one second). A batch-size based definition includes partitioning atleast one incoming NRT data stream by a most recently received portionlimited or restricted to or constrained by a data size (e.g., one batchincludes 10 MB of most recently received event tuples). In otherimplementations, a combination of time-size basis and batch-size basisis used to define batches. In some other implementations, each batch ina pipeline is identified by a unique batch identifier (ID).

Batch-Unit: A micro unit of work of a batch is called a batch-unit. Abatch is subdivided into a set of batch units. In some implementations,different batch-units of a batch are processed in different stages atdifferent computation units of a container, a concept referred to as“multi-stage processing”. In some other implementations, a batch is atransactional boundary of stream processing within a container, such atransaction is considered to be complete when a batch is completelyprocessed and is considered incomplete when a batch overruns a time-outwithout all of its batch-units being processed.

Coordinator: The coordination between a pipeline that includes data tobe processed and the worker nodes that process the data is carried outthrough a software component of the container called a “coordinator”,which is in charge of distribution of tasks to the physical threads in aworker node. This application interchangeably refers to a “coordinator”as a “grid-coordinator”, and vice-versa.

Scheduler: A scheduler tracks one or more pipelines in a container andcommunicates with the coordinator to schedule execution of batches inthe container. In some implementations, a scheduler maintains thecurrent batch stage information during multi-stage processing of a batchand communicates this information along with identification of the batchand pipeline to the coordinator. This application interchangeably refersto a “scheduler” as a “grid-scheduler”, and vice-versa.

Parallelism: A container runs a user-specified number of logicallyparallel threads, fixed by a developer of a container. A “logicallyparallel threads” value specifies how many threads are to besimultaneously utilized by the container during processing of batches ina pipeline.

Near Real-Time Data Stream: A near real-time (NRT) data stream isdefined as an unbounded sequence of event tuples that is processed inparallel and distributed among multiple worker nodes. In oneimplementation, a NRT data stream is defined as a collection ofreal-time events for a task sequence or a particular stage of a tasksequence. In another implementation, a NRT data stream is defined as acollection of events that are registered as they are generated by anentity. In one implementation, a NRT data stream is an unboundedsequence of data tuples. In some implementations, a NRT data stream hasan emission rate of one million events or tuples per second.

Stream Processing Framework: A “stream processing framework” is definedas a real-time stream processing system that represents an entirestreaming application as a graph of computation. In someimplementations, the stream processing framework processes NRT datastreams for one or more task sequences to generate real-time analytics.This application interchangeably refers to a “stream processingframework” as a “stream processing system”, and vice-versa.

Internet of Things Platform: The “Internet of Things (IoT) platform”disclosed herein is defined as an integrated environment that collectsand processes a high volume of data from a plurality of entities inreal-time or near real-time, often with low latency. In some instances,processing logic can be applied to the data to generate real-time ornear real-time analytics. In one implementation, an IoT platform isdefined as an integrated framework that utilizes computation over acombination of stream mode and batch mode to periodically generateaggregates using batch and offline analytics and substitute results fromreal-time data streams to generate real-time analytics by performingcomputational tasks like data mining, machine learning, statisticalprocessing, predictive analytics, time series analysis, rule basedprocessing, complex event processing, pattern detection, correlation andmore. In one implementation, the IoT platform offers a high throughputof the order of processing one million tuples per second per node. Inanother implementation, the IoT platform offers insights to end-users inthe form of rich visualization, using GUI and/or API based tools likestandard graphs, bars, charts and overlaid infographics.

Event: An event is any identifiable unit of data that conveysinformation about an occurrence. In one implementation, an event canalso provide information concerning an entity. An event can have threeaspects: a timestamp indicating when the event occurred; a set ofdimensions indicating various attributes about the event; and a set ofmetrics related to the event. Events can be user-generated events suchas keystrokes and mouse clicks, among a wide variety of otherpossibilities. System-generated events include statistics (e.g.latency/number of bytes, etc.), program loading and errors, also among awide variety of other possibilities. In one implementation, eventsinclude network flow variables, device information, user and groupinformation, information on an application (e.g., resource condition,variables and custom triggered events). An event typically representssome message, token, count, pattern, value, or marker that can berecognized within a NRT data stream, such as network traffic, specificerror conditions or signals, thresholds crossed, counts accumulated, andso on. A typical user interaction with an application like Pardot™processes a sequence of events that occur in the context of a session.The main events of note are (a) login—provide user credentials to ahosted service to authenticate the user; (b) applicationtransactions—execute a set of application level transactions, e.g. addleads or define new operations; and (c) log-out—this event terminatesthe session with the server. In some implementations, deep packetinspection logic tracks raw event data to identify events and storesthem in an event repository. This application, in some implementations,interchangeably refers to “events” as “data”, and vice-versa. Otherexamples of events generated by or about various entities includetelemetry from a wearable sensor, data from a smart watch, data and/ormetadata generated by a user using a feature of an application (such asMicrosoft Word™), trip or journey data generated from a GPS used by adriver starting or completing a trip, data generated by a vehiclereporting speed or location information, data generated by a medicaldevice reporting a sensor reading, etc.

Entity: An entity is defined as a thing or object that interacts andcommunicates with other things or objects and with the environment byexchanging data and information sensed about the environment whilereacting to real/physical world events, to provide services forinformation transfer, analytics, applications and communications.Examples of entities include humans, online social networks,wireless/wired sensors, smart phones, smart watches, application PCs,PCs, laptops, tablets, IP telephones, servers, application servers,cameras, scanners, printers, near-field communication devices like RFIDtags and RFID readers, vehicles, biomedical equipment, and others. Insome implementations, the singular “entity” and the plural “entities”are used interchangeably in this application for clarity. In thisapplication, in some implementations, “entities” are “data sources”,“users”, and other actors.

Online Social Network: An “online social network” is defined as anycombination of software, protocols and/or hardware configured to allow acommunity of users or individuals and/or other entities to shareinformation, resources and the like via a computer network (such as theInternet). An online social network uses a platform like a website, blogor forum to foster interaction, engagement and information sharing. Someexamples of an online social network include Facebook™, Twitter™,YouTube™, Flickr™, Picasa™, Digg™, RSS™, Blogs™, Reddit™, LinkedIn™,Wikipedia™ Pinterest™, Google Plus+™, MySpace™, Bitly™ and the like.This application, in some implementations, interchangeably refers to“online social network” as “social network”, “social media site”,“social networking service”, “social media source” and “socialnetworking entity”, and vice-versa.

Application Programming Interface: An “application programming interface(API)” is defined as a packaged collection of code libraries, methodsand fields that belong to a set of classes, including its interfacetypes. The API defines the way that developers and programmers can usethe classes for their own software development, just by importing therelevant classes and writing statements that instantiate the classes andcall their methods and fields. In another implementation, an API is asource code based specification intended to be used as an interface bysoftware components to communicate with each other. An API can includespecifications for routines, data structures, object classes andvariables. Basically, an API provides an interface for developers andprogrammers to access the underlying platform capabilities and featuresof online social networks. For example, Twitter's Search API involvespolling Twitter's data through a search or username. Twitter's SearchAPI gives developers and programmers access to data set that alreadyexists from tweets which have occurred. Through the Search API,developers and programmers request tweets that match search criteria.The criteria can be keywords, usernames, locations, named places, etc.In another example, Twitter's Streaming API is a push of data as tweetsare posted in near real-time. With Twitter's Streaming API, developersand programmers register a set of criteria (e.g., keywords, usernames,locations, named places, etc.) and as tweets match the criteria, theyare pushed directly to the developers and programmers. In yet anotherexample, Twitter Firehose pushes data to developers and programmers innear real-time and guarantees delivery of all the tweets that match theset criteria.

Application: An application refers to a network hosted service accessedvia a uniform resource locator (URL). Examples include software as aservice (SaaS) offerings, platform as a service (PaaS) offerings, andinfrastructure as a service (IaaS) offerings, as well as internalenterprise applications. Examples of applications include Salesforce1Platform™, Sales Cloud™, Data.com™, Service Cloud™, Desk.com™ MarketingCloud™, Pardot™, Wave Analytics™, Box.net™, Dropbox™, Google Apps™,Amazon AWS™, Microsoft Office 365™, Workday™, Oracle on Demand™ Taleo™,Yammer™ and Concur™. In one implementation, an application offersinsights to end-users in the form of rich visualization, using GUIand/or API based tools like standard graphs, bars, charts and overlaidinfographics.

Identification: As used herein, the “identification” of an item ofinformation does not necessarily require the direct specification ofthat item of information. Information can be “identified” in a field bysimply referring to the actual information through one or more layers ofindirection, or by identifying one or more items of differentinformation which are together sufficient to determine the actual itemof information. In addition, the term “specify” is used herein to meanthe same as “identify.”

Introduction

We describe a system and various implementations of handling multipletask sequences including long tail task sequences on a limited number ofworker nodes of a stream processing system. The technology disclosedincludes defining containers over worker nodes that have physicalthreads, with one physical thread utilizing a whole processor core of aworker node. It also includes, for multiple task sequences, queuing datafrom incoming near real-time (NRT) data streams in pipelines that run inthe containers, processing data from the NRT data streams as batchesusing a container-coordinator that controls dispatch of the batches, anddispatching the batches to the physical threads, where a batch runs tocompletion or to a time out, including during execution, comparing acount of available physical threads against a set number of logicallyparallel threads. It further includes, when a count of availablephysical threads equals or exceeds the number of logically parallelthreads, concurrently processing the batches at the physical threads,and when there are fewer available physical threads than the number oflogically parallel threads, multiplexing the batches sequentially overthe available physical threads.

The technology disclosed improves existing streaming processing systemsby allowing the ability to both scale up and scale down resources withinan infrastructure of a stream processing system. In addition, thetechnology disclosed leverages common dependencies between tasksequences running in a container to reduce the strain on sharedresources by eliminating dedicated per-pipeline hardware. Furthermore,the technology disclosed introduces natural elasticity to streamprocessing systems by minimizing the impact of small workloads on thesystems.

Apache Storm™, Apache Trident™, Apache Spark™, Apache Samza™ ApacheFlink™, etc. and most existing stream processing systems haveclassically focused exclusively on scaling up and scaling out ofcomputational resources in a quest for more performance. These systemsdo not typically perform well in a constrained resource environment suchas a small two-to-three machine cluster. Spark for example simply startscrashing once its in-memory grid is exhausted and also requires aminimum of one dedicated core per consumed Kafka partition. Running afew hundred simultaneous consumers in these systems requires potentiallyhundreds of dedicated cores. Storm with a two-to-three machine clusterruns at most perhaps twelve tasks sequences before requiring addition ofmore machines. This makes these platforms appropriate only for largescale data processing that can justify the dedicated hardware required(which is what they are designed to serve).

For smaller, trivial workloads or data patterns that have wild variancein their load over time, these platforms are extremely expensive due tothe minimum cost of hardware associated with a single “job”. What thismeans to a user is that they would typically need to decide whether ajob is “big enough” to justify porting it to something like Storm orSpark.

The technology disclosed particularly singles out long tail tasksequences that may initially have heavy activity but may need to remainactive for months waiting for perhaps dozens of messages a day. In thiscase, a big-data platform is needed for the initial activity and afterthe initial early load, the dedicated hardware would have historicallybeen wasted because it mostly was doing nothing. In Storm, no matter howtrivial the workload, if there are a thousand topologies, at least 1000workers are needed to run them, which equates to roughly 250 machineinstances if four workers are being run per machine. The technologydisclosed allows for running one topology on a thousand machines or athousand topologies on one machine.

The primary benefits of the disclosed solution include allowing users torun an arbitrary amount of work on a fixed hardware budget and allowingusers to utilize the same environment, infrastructure and tools for bothsmall and large jobs.

The technology disclosed also leverages common dependencies across tasksequences. A job can always run in a dedicated container, which gives itfull use of all available resources and excellent isolation from otherprocesses. When jobs are multiplexed within the same container, theylose this isolation but gain locality which carries other benefits. Forexample, a typical application server shares a connection pool acrossall the applications hosted therein. The technology disclosed cangreatly reduce the strain on shared resources such as databases andmessage buses like Kafka™, persistence stores like Cassandra™ and globalservice registry like ZooKeeper™. In the technology disclosed,connections to Kafka™, Cassandra™ and ZooKeeper™ are all shared acrosshosted pipelines, thereby greatly reducing the potential load on theseservices. In some cases, the technology disclosed can eliminatededicated per-pipeline hardware by leveraging shared local caches ofresources. For instance, dozens of pipelines can read from the sameKafka topic without the need to make a call to Kafka for every pipeline.

Large systems hosting multiple workloads tend to be more naturallyelastic than dedicated systems. For example, threads doing small amountsof work introduce only small delays in busier threads because they onlyborrow shared resources for exactly the amount of time they are needed.Dedicated systems instead depend on monitoring and dynamic allocation ofresources, ideally adding and removing servers as workloads change. Thisis complicated to implement and plan for with an accurate budget. Thetechnology disclosed adapts a stream processing system to minimize theimpact of small workloads, thereby making the system more naturallyelastic and more gracefully changeable as workloads change. An exampleincludes two tasks sequences, one for the U.S. and one for Europe. Thesetwo task sequences receive the bulk of their loads at opposite times ofday. The technology disclosed applies most of the allocated resources(e.g. ninety percent) to the tasks sequence with actual load without acomplex system of adding boxes for the time from 12 am to 4 am on onetask sequence and adding boxes for the time from 3 pm to 6 pm on theother.

The technology disclosed relates to simplifying for a non-programminguser creation of an entity management workflow by usingcomputer-implemented systems. The technology disclosed can beimplemented in the context of any computer-implemented system includinga database system, a multi-tenant environment, or a relational databaseimplementation like an Oracle™ compatible database implementation, anIBM DB2 Enterprise Server™ compatible relational databaseimplementation, a MySQL™ or PostgreSQL™ compatible relational databaseimplementation or a Microsoft SQL Server™ compatible relational databaseimplementation or a NoSQL non-relational database implementation such asa Vampire™ compatible non-relational database implementation, an ApacheCassandra™ compatible non-relational database implementation, aBigTable™ compatible non-relational database implementation or an HBase™or DynamoDB™ compatible non-relational database implementation.

Moreover, the technology disclosed can be implemented using two or moreseparate and distinct computer-implemented systems that cooperate andcommunicate with one another. The technology disclosed can beimplemented in numerous ways, including as a process, a method, anapparatus, a system, a device, a computer readable medium such as acomputer readable storage medium that stores computer readableinstructions or computer program code, or as a computer program productcomprising a computer usable medium having a computer readable programcode embodied therein.

In addition, the technology disclosed can be implemented using differentprogramming models like MapReduce™, bulk synchronous programming, MPIprimitives, etc. or different stream management systems like ApacheStorm™, Apache Spark™, Apace Kafka™, Truviso™, IBM Info-Sphere™,Borealis™ and Yahoo! S4™.

IoT Platform and Stream-Batch Processing Framework

We describe a system and various implementations of simplifying for anon-programming user creation of an entity management workflow. Thesystem and processes will be described with reference to FIG. 1 and FIG.2 showing an architectural level schematic of a system in accordancewith an implementation. Because FIG. 1 and FIG. 2 are architecturaldiagrams, certain details are intentionally omitted to improve theclarity of the description. The discussion of FIG. 1 and FIG. 2 will beorganized as follows. First, the elements of respective figures will bedescribed, followed by their interconnections. Then, the use of theelements in the system will be described in greater detail.

FIG. 1 includes exemplary IoT platform 100. IoT platform 100 includesdata sources 102, input connectors 104, stream container(s) 106, batchcontainer(s) 108, rich contextual data store 110, orchestration system112, output connectors 122 and application(s) 123. The rich contextualdata store 110 includes various storage nodes C1-C3. Orchestration 112includes a data entry columnar 114, an explorer engine 115, a livedashboard builder engine 116, a morphing engine 117, a tweening engine118, a tweening stepper 119, an integrated development environment (IDE)121 and a rendering engine 120. Application(s) 123 include various SaaS,PaaS and IaaS offerings. In other implementations, platform 100 may nothave the same elements as those listed above and/or may haveother/different elements instead of, or in addition to, those listedabove.

FIG. 2 illustrates a stream processing framework 200 used in theplatform example shown in FIG. 1, according to one implementation of thetechnology disclosed. Framework 200 includes data sources 102, inputpipeline 204, stream container 106, rich contextual data store 110 andoutput pipeline 218. Stream container 106 includes an emitter tier 206,a scheduler 208, a coordinator 210 and a worker tier 214. In otherimplementations, framework 200 may not have the same elements as thoselisted above and/or may have other/different elements instead of, or inaddition to, those listed above.

The interconnection of the elements of IoT platform 100 and streamingframework 200 will now be described. A network (not shown) couples thedata sources 102, the input connectors 104, the stream container 106,the batch container 108, the rich contextual data store 110, theorchestration system 112, the columnar 114, the output connectors 122,the application(s) 123, the input pipeline 204, the emitter tier 206,the scheduler 208, the coordinator 210, the worker tier 214 and theoutput pipeline 218, all in communication with each other (indicated bysolid arrowed lines). The actual communication path can bepoint-to-point over public and/or private networks. Some items, such asdata from data sources 102, might be delivered indirectly, e.g. via anapplication store (not shown). All of the communications can occur overa variety of networks, e.g. private networks, VPN, MPLS circuit, orInternet, and can use appropriate APIs and data interchange formats,e.g. REST, JSON, XML, SOAP and/or JMS. All of the communications can beencrypted. The communication is generally over a network such as the LAN(local area network), WAN (wide area network), telephone network (PublicSwitched Telephone Network (PSTN), Session Initiation Protocol (SIP),wireless network, point-to-point network, star network, token ringnetwork, hub network, Internet, inclusive of the mobile Internet, viaprotocols such as EDGE, 3G, 4G LTE, Wi-Fi and WiMAX. Additionally, avariety of authorization and authentication techniques, such asusername/password, OAuth, Kerberos, SecureID, digital certificates andmore, can be used to secure the communications.

Having described the elements of FIG. 1 (IoT platform 100) and FIG. 2(streaming framework 200) and their interconnections, the system willnow be described in greater detail.

Data sources 102 are entities such as a smart phone, a WiFi accesspoint, a sensor or sensor network, a mobile application, a web client, alog from a server, a social media site, etc. In one implementation, datafrom data sources 102 are accessed via an API Application ProgrammingInterface) that allows sensors, devices, gateways, proxies and otherkinds of clients to register data sources 102 in the IoT platform 100 sothat data can be ingested from them. Data from the data sources 102 caninclude events in the form of structured data (e.g. user profiles andthe interest graph), unstructured text (e.g. tweets) and semi-structuredinteraction logs. Examples of events include device logs, clicks onlinks, impressions of recommendations, numbers of logins on a particularclient, server logs, user's identities (sometimes referred to as userhandles or user IDs and other times the users' actual names), contentposted by a user to a respective feed on a social network service,social graph data, metadata including whether comments are posted inreply to a prior posting, events, news articles, and so forth. Eventscan be in a semi-structured data format like a JSON (JavaScript OptionNotation), BSON (Binary JSON), XML, Protobuf, Avro or Thrift object,which present string fields (or columns) and corresponding values ofpotentially different types like numbers, strings, arrays, objects, etc.JSON objects can be nested and the fields can be multi-valued, e.g.,arrays, nested arrays, etc., in other implementations.

As described infra, near real-time (NRT) data streams 103 arecollections of events that are registered as they are generated by anentity. In one implementation, events are delivered over HTTP to inputpipeline 204. In another implementation, events are transmitted via POSTrequests to a receiver operating on behalf of input pipeline 204. Forinstance, Twitter Firehose API (accessible via Twitter-affiliatedcompanies like Datashift, nTweetStreamer, tiwwter4j) provides unboundedtime stamped events, called tweets, as a stream of JSON objects alongwith metadata about those tweets, including timestamp data about thetweets, user information, location, topics, keywords, retweets,followers, following, timeline, user line, etc. These JSON objects arestored in a schema-less or NoSQL key-value data-store like ApacheCassandra™, Google's BigTable™, HBase™ Voldemort™, CouchDB™, MongoDB™,Redis™, Riak™, Neo4j™, etc., which stores the parsed JSON objects usingkey spaces that are equivalent to a database in SQL. Each key space isdivided into column families that are similar to tables and comprise ofrows and sets of columns.

The input connectors 104 acquire data from data sources 102 andtransform the data into an input format that is consumable by containers106 and 108. In one implementation, the input connectors 104 performfull data pulls and/or incremental data pulls from the data sources 102.In another implementation, the input connectors 104 also access metadatafrom the data sources 102. For instance, the input connectors 104 issuea “describe” API call to fetch the metadata for an entity and then issuethe appropriate API call to fetch the data for the entity. In someimplementations, customized input connectors 104 are written using theConnector SDK™ for individual data sources 102.

In other implementations, a workflow definition includes a collection ofconnectors and operators as well as the order to execute them. In oneimplementation, such a workflow is specified as a directed graph, whereconnectors and operators are graph nodes and edges reflect the dataflow. In yet other implementations, multiple data streams 103 are joinedand transformed before being fed to the containers 106 and 108.

Batch processing framework operating in container(s) 108 generatesbusiness intelligence using OnLine Analytical Processing (OLAP) queries,which are stored in rich contextual data store 110. In oneimplementation, events are stored in batch container(s) 108 to act as abackup for raw events on which batch processing jobs can run at anygiven time. Batch container(s) 108, in some implementations, providesraw counts as well as descriptive statistics such as mean, median andpercentile breakdowns. In one implementation, analytics tool likeScalding™ and Pig™ are included in batch container(s) 108 to provideretrospective analysis, machine learning modeling, and other batchanalytics. In yet other implementations, batch container(s) 108 is usedto correct errors made by the stream container 106 or to handle upgradedcapabilities by running analytics on historical data and recomputeresults. Examples of a batch processing framework include Hadoopdistributed file system (HDFS) implementing a MapReduce programmingmodel.

Batch container(s) 108 ingest event tuples from respective inputpipelines that collect data for a plurality of NRT data streams. In someimplementations, multiple NRT data streams can be assigned to a singlepipeline and multiple pipelines can be assigned to a single batchcontainer.

Stream processing framework 200 provides near real-time (NRT) processingof sequences of unbounded events for delivery of immediate analytics andinsights based on the events as they are occurring. In oneimplementation, framework 200 processes one million events per secondper node. Framework 200 can be implemented using one or more streamprocessors like Apache Storm™ and Apache Samza™ or a batch-streamprocessor such as Apache Spark™. In one implementation, framework 200includes an API to write jobs that run over a sequence of event-tuplesand perform operations over those event-tuples.

Events are ingested into framework 200 by input pipeline 204, whichreads data from the data sources 102 and holds events for consumption bythe stream container 106. In one implementation, input pipeline 204 is asingle delivery endpoint for events entering the container 106. Examplesof input pipeline 204 include Apache Kafka™ Kestrel™, Flume™, ActiveMQ™,RabbitMQ™, HTTP/HTTPS servers, UDP sockets, and others. In someimplementations, input pipeline 204 includes a listener capable oflistening NRT data streams 103 and data flows originating from the datasources 102 by connecting with their respective APIs (e.g., Chatter API,Facebook API (e.g., Open Graph), Twitter API (e.g., Twitter Firehose,Sprinklr, Twitter Search API, Twitter Streaming API), Yahoo API (e.g.,Boss search) etc.) via the Internet. In some implementations, a listenerincludes heterogeneous instances responsible for the intake of data fromdifferent data sources 102. According to an implementation, the inputpipeline 204 can be configured to receive the data over the network(s)using an application protocol layer, or other higher protocol layer,such as HTTP protocol layer, among many possible standard andproprietary protocol layers. These higher protocol layers can encode,package and/or reformat data for sending and receiving messages over anetwork layer, such as Internet Protocol (IP), and/or a transport layer,such as Transmission Control Protocol (TCP) and/or User DatagramProtocol (UDP).

In a particular implementation, Apache Kafka™ is used as the inputpipeline 204. Kafka is a distributed messaging system with a publish andsubscribe model. Kafka maintains events in categories called topics.Events are published by so-called producers and are pulled and processedby so-called consumers. As a distributed system, Kafka runs in acluster, and each node is called a broker, which stores events in areplicated commit log. In other implementations, different messaging andqueuing systems can be used.

In one implementation, NRT data streams 103 are queued in input pipeline204 as batches. In one implementation, a batch is defined as anassemblage of event tuples, also referred to as “units of work”,partitioned on a time-slice basis and/or a batch-size basis. Atime-slice based definition includes partitioning at least one incomingNRT data stream by its most recently received portion within a timewindow (e.g., one batch keeps the event tuples from last one second). Abatch-size based definition includes partitioning at least one incomingNRT data stream by a most recently received portion limited orrestricted to or constrained by a data size (e.g., one batch includes 10MB of most recently received event tuples). In other implementations, acombination of time-size basis and batch-size basis is used to definebatches.

In a particular implementation, Apache Storm™ operates in streamcontainer 106 and performs real-time computation using a matrix ofuser-submitted directed acyclic graphs, comprised of a network of nodescalled “Spouts” or “emitter nodes” (collectively referred to as theemitter tier 206 in FIG. 2) and “Bolts” or “worker nodes” (collectivelyreferred to as the worker tier 214 in FIG. 2). In a Storm matrix, aSpout is the source of NRT data streams 103 and a Bolt holds thebusiness logic for analyzing and processing those streams to produce newdata as output and passing the output to the next stage in the matrix.In one implementation, a special Kafka Spout emits events read from aKafka topic as batches to the bolts in worker tier 214.

Worker tier 214 includes bolts or worker nodes (shown as cubes in FIG.2) that perform various stream processing jobs such as simple datatransformation like id to name lookups, up to complex operations such asmulti-stream joins. Specifically, worker nodes in the worker tier 214can perform tasks like aggregations, functions and stream groupings(e.g., shuffle grouping, fields grouping, all grouping, and globalgrouping), filtering and commits to external persistence layers likerich contextual data store 110. In some implementations, worker nodes ina worker tier 214 have transitive dependencies between relatedprocessing stages where upstream stages produce event tuples that areconsumed by downstream stages.

The messages passed within stream container 106 are called tuples. Atuple is a set of values for a pre-defined set of fields. Each spout andbolt defines the fields of the tuples it emits statically in advance.All tuples are serialized into a binary form before transmission toother components in the stream container 106. In some implementations,this serialization is handled by the Kryo library, which provides a fastserialization of Java objects.

Stream container 106 allows for parallelization of spouts and boltsusing different tuple grouping strategies to pass event streams. Thegrouping strategy defines the partitioning of an event stream andcontrols the number of logically parallel threads of the nextcomputational unit—the degree of parallelism refers to the number ofparallel executions.

Scheduler 208 tracks one or more input pipelines (e.g., input pipeline204) in the stream container 106 and schedules execution of batches andany downstream processing stages that depend on the output of anupstream completed processing stage. In one implementation, scheduler208 assigns a unique batch identifier (ID) to each batch in the inputpipeline 204. Further, scheduler 208 triggers either a resend of thecurrent batch or the next batch along with corresponding stageinformation on a per pipeline basis. Scheduler 208 also sends messagesto the coordinator 210 in the form [pipeline:‘a’,batch:7,stage‘b’]. Insome other implementations, scheduler 208 assigns priority-levels todifferent pipelines in the IoT platform 100. These priority-levelscontrol execution of a first number of batches from a first pipelinebefore execution of a second number of batches from a second pipeline.

Coordinator 210 controls dispatch of batches to worker nodes in theworker tier 214. When the scheduler 208 triggers a batch-stage, thecoordinator 210 sends triggers to the emitter tier 206 and worker tier214 who are responsible for that particular stage. When[pipeline:‘a’,batch:7,stage‘b’] is received by the coordinator 210, itcontacts two of the hundred available worker nodes. These are the twoworker nodes that received input from stage ‘a’.

Coordinator 210 also tracks pending units of work in the streamcontainer 106 for a given batch-stage to enable efficient “long-tail”operations where it is likely that a substantial portion of theallocated resources for a process may not be needed for a particularbatch. Take a single distributed operation having stage [a] and stage[b] such that the output of stage [a] is used at stage [b], representedas stage [a]→stage [b]. Now, assume that according to one implementationstage [a] runs on hundred worker nodes (each running on a physical node)and stage [b] runs on hundred worker nodes (each running on a physicalnode) and stage [a] produces output only for two instances of stage [b].When stage [a] has fully executed and stage [b] begins, the coordinator210 knows that only two of the hundred worker nodes allocated to stage[b] need to be invoked. Similarly for three stage processing,represented as stage [a]→stage [b]→stage [c], where stage [b] receivesno input from stage [a] and therefore stage [c] will also receive noinput, coordinator 210 avoids all extraneous communication to stage [b]and stage [c]. In the case of all data in stage [a] being filtered out,there is no communication overhead with the worker nodes allocated tostage [b] and stage [c].

Stream container(s) 106 ingest event tuples from respective inputpipelines that collect data for a plurality of NRT data streams. In someimplementations, multiple NRT data streams can be assigned to a singlepipeline and multiple pipelines can be assigned to a single streamcontainer.

Rich contextual data store 110 stores large volumes of historical dataand allows for historical query based analytics that are combined withnear real-time analytics. In one implementation, rich contextual datastore 110 is used to take a snapshot of tasks in the IoT platform 100and store state information about the pipelines, spouts, bolts and otherelements of the IoT platform 100. In some implementations richcontextual data store 110 is a NoSQL key-value column store distributedstorage system like Apache Cassandra™. Data sent to Cassandra™ is spreadout across many nodes or commodity servers C1-C3, connections to whichcan be made using a Java, Scala, Ruby, Clojure or Python based APIs(e.g., Hector, Pelops, CQL, Thrift, Phpcassa, PyCassa, etc.). Cassandrastores data in units called columns. Each column is a tuple, a list ofassociated data elements. The basic column format can be represented as(name, value, timestamp). For brevity, the timestamp, while an essentialelement of the column, is often not written. Thus, an example column maybe written (UserName, User-1). An optional level of hierarchy called asuper column may incorporate any number of columns. Moving up a level,keys (sometimes referred to as rows) are tuples that include a name andone or more columns or super columns. An example key may be written(Status_Key, (UserName, User-1), (Logged_In, Y). Any number of keys maybe grouped into a column family. Analogously, a group of column familiesis referred to as the keyspace, the final level of hierarchy. Two pseudocode representations of the relationship can be constructed as follows:

[keyspace] [column family] [key] [column] [keyspace] [column family][key] [super column] [column]

Output pipeline 218 collects and queues processed events for delivery toa persistent store. In one implementation, data from output pipeline 218is transmitted concurrently to a SQL data store and NoSQL data storelike rich contextual data store 110. Output pipeline 218 can also behosted by Kafka, which acts a sink for the output of the jobs.

Orchestration

Orchestration 112 includes a web platform that enables non-programmersto construct and run an entity management workflow. Orchestration 112utilizes a declarative and visual programming model that generates adata entry columnar 114, which accepts declarative and drag-drop input.In one implementation, orchestration 112 allows non-programmers todesign their own workflows visually without extensive programmingknowledge. In one implementation, orchestration 112 uses a formaldeclarative description stored in a JSON configuration file. The JSONfile defines behaviors used in a session, including states of an entityduring a life cycle that specify events to handle, state transitiontriggers the transition rules to be used, and responsive actions thatspecify the actions rules to be used, along with other parameters andvariables to be used in a workflow. In other implementations, differentprogramming languages like hypertext markup language (HTML), standardgeneralized markup language (SGML), declarative markup language (DML),extensible markup language (XAML and XML), extensible stylesheetlanguage (XSL), extensible stylesheet language transformations (XSLT),functional programming language like Haskell and ML, logic programminglanguage like Prolog, dataflow programming language like Lucid,rule-based languages like Jess, Lips and CLIPS, and others.

In another implementation, orchestration 112 includes a declarativecomponent and a run-time component. Using the declarative component, anon-programmer declares entity states, transition triggers for thestates, responsive actions for the states and other parameters andvariables of the entity lifecycle workflow. In one implementation, thedeclarative component offers existing workflow or workflow excerptscommon used by other users and communities. In one implementation, thedeclarative input is received at a browser in a visual manner ratherthan as a result of writing code. The declarative input is thentranslated by orchestration 112 into a package of declarative files(e.g., XML) that can be directly executed in the run-time component.

In a further implementation, the run-time component of orchestration 112includes a translator that interprets the declarative files usingrelational and XML-native persistent services, gateway, SOAP, REST APIand semantic functionalities like machine learning, clustering,classifier-based classification and recommendation, context textanalysis, text extraction and modeling, deep linguistic analysis andexpressions based alphanumeric pattern detection.

In yet another implementation, orchestration 112 serves as a rule engineand scripting environment for non-declarative languages like Java andC++. In such an implementation, orchestration 112 provides rule-basedprogramming in a high-level procedural or imperative programminglanguage by continuously applying a set of rules to a set of facts. Therules can modify the facts or execute and procedural or imperative code(e.g., Java code). In some implementations, orchestration 112 includes agraphical rule development environment based on an integrateddevelopment environment (IDE) providing editor functions, codeformatting, error checking, run and debug commands and a graphicaldebugger.

Orchestration 112 also includes an explorer engine 115, a live dashboardbuilder engine 116, a morphing engine 117, a tweening engine 118, atweening stepper 119, an integrated development environment (IDE) 121and a rendering engine 120.

A disclosed live dashboard builder engine 116 designs dashboards,displaying multiple analytics developed using the explorer engine 115 asreal-time data query results. That is, a non-technical user can arrangedisplay charts for multiple sets of query results from the explorerengine 115 on a single dashboard. When a change to a rule-base affectsany display chart on the dashboard, the remaining display charts on thedashboard get updated to reflect the change. Accurate live query resultsare produced and displayed across all display charts on the dashboard.

In one implementation, a real-time query language called “EQL language”is used by orchestration 112 to enable data flows as a means of aligningresults. It enables ad hoc analysis of registered event tuples. Anon-technical user can specify state definitions, state transitiontriggers, state transition conditions and state transition actions tochange query parameters and can choose different display options, suchas a bar chart, pie chart or scatter plot—triggering a real-time changeto the display chart—based on a live data query using the updatedrule-base. Statements in EQL include keywords (such as filter, group,and order), identifiers, literals, or special characters. EQL isdeclarative; you describe what you want to get from your query. Then, aquery engine will decide how to efficiently serve it.

In one implementation, a runtime framework with an event bus handlescommunication between application(s) 123 running on user computingdevices, a query engine (not shown) and an integrated developmentenvironment 121, which provides a representation of animated datavisualizations implemented in a hierarchy of levels including states,triggers, state transitions, responsive actions, entity activity levelsand variations among them over time, real-time event streams, trails ofentity transitions from one state to another, and the sizes of the statetypes based on a number of entities belonging to a particular statetype.

Integrated development environment 121 provides a representation ofanimated data visualizations and provides an interface for processinganimation scripts that animate transitions between the shapes applied todata visualizations. Example animation transitions include scaling sothat charts fit the display environment, and are not clipped; androtations between vertical and horizontal display. Animation scripts arerepresented using non-procedural data structures that represent shapesto be rendered, and that represent animations of the transitions betweenthe shapes to be rendered. In one example implementation, JSON can beused to express the generated non-procedural data structures.

Rendering engine 120 transforms non-procedural data structures thatrepresent the shapes and the animation of transitions between theshapes, into rendered graphics.

In other implementations, orchestration 112 may not have the sameelements as those listed above and/or may have other/different elementsinstead of, or in addition to, those listed above.

The output connectors 122 send data from orchestration 112 and/or outputpipeline 218 and transform the data into an output format that isconsumable by application(s) 123. In one implementation, the outputconnectors 122 perform full data pushes and/or incremental data pushesfrom orchestration 112. In another implementation, the output connectors122 also provide metadata from the orchestration 112. In someimplementations, customized output connectors 122 are written using theConnector SDK™ for individual application(s) 123.

Application(s) 123 include components adapted for operating in the IoTplatform 100. The IoT platform 100, or an analog, can be provided by anode such as an application server node. Application(s) 123 can includean incoming and outgoing data handler component for receiving andtransmitting information from and to the plurality of application servernodes via the network(s).

In an implementation, the application(s) 123 include a data store forstoring a plurality of data objects including a plurality of contactrecords, a plurality of account records, and/or other records(collectively application records). In some implementations, anapplication record can include, but is not limited to, a tuplecorresponding to a user, a file, a folder, an opportunity, an account,an event, and/or any data object. Application(s) 123 can include a datamanager component that can be configured to insert, delete, and/orupdate the records stored in the data store. In addition, application(s)123 can include a monitoring agent that is configured to monitoractivities related to the application records. For example, themonitoring agent can be configured to track a user's post via a publicor private social networking service, and/or a user's e-mail client onthe user's enterprise desktop computer, and to monitor updates to thecontact records, event records, and/or any other application record(s)stored in the data store.

Processed events can additionally be used by application(s) 123, such asSalesforce.com offerings like Sales Cloud™, Data.com™, Service Cloud™,Desk.com™ Marketing Cloud™, Pardot™, Service Cloud™ and Wave Analytics™.For example, processed events can be used to identify opportunities,leads, contacts, and so forth, in the application(s) 123, or can be usedto support marketing operations with products such as Radian6™, BuddyMedia™ services, and the like. The processed events can also then inturn be used to find these specific users again on these socialnetworks, using matching tools provided by the social network providers.Additionally they could also be layered with specific targeting learnedfrom the aggregation and analysis by the stream container 106 andorchestration 112 respectively.

In an implementation, IoT platform 100 can be located in a cloudcomputing environment, and may be implemented as a multi-tenant databasesystem. As used herein, the term multi-tenant database system refers tothose systems in which various elements of hardware and software of thedatabase system may be shared by one or more tenants. For example, agiven application server may simultaneously process requests for a greatnumber of tenants, and a given database table may store rows formultiple tenants.

In some implementations, the elements or components of IoT platform 100can be engines of varying types including workstations, servers,computing clusters, blade servers, server farms, or any other dataprocessing systems or computing devices. The elements or components canbe communicably coupled to the databases via a different networkconnection. For example, stream container 106 can be coupled via thenetwork(s) (e.g., the Internet), batch container 108 can be coupled viaa direct network link, and orchestration 112 can be coupled by yet adifferent network connection.

In some implementations, databases used in IoT platform 100 can storeinformation from one or more tenants into tables of a common databaseimage to form a multi-tenant database system. A database image caninclude one or more database objects. In other implementations, thedatabases can be relational database management systems (RDBMS), objectoriented database management systems (OODBMS), distributed file systems(DFS), no-schema database management systems, or any other data storingsystems or computing devices.

While IoT platform 100 is described herein with reference to particularblocks, it is to be understood that the blocks are defined forconvenience of description and are not intended to require a particularphysical arrangement of component parts. Further, the blocks need notcorrespond to physically distinct components. To the extent thatphysically distinct components are used, connections between components(e.g., for data communication) can be wired and/or wireless as desired.The different elements or components can be combined into singlesoftware modules and multiple software modules can run on the samehardware.

Concurrent and Multiplexed Processing Combination

FIG. 3 is one implementation 300 of worker tier 214 that includes aworker node 1, with a plurality of physical threads PT1-PT10. Eachphysical thread PT1-PT10 utilizes a whole processor core of the workernode 1 selected from one of the processor cores 1-10. Worker tier 214also includes worker nodes 2-3, which have their own seta of physicalthreads, with each physical thread utilizing a whole processor core.

FIG. 4A depicts one implementation 400A of concurrently processingbatches in a pipeline, when a count of available physical threads equalsor exceeds a set number of logically parallel threads. In exemplaryscenario illustrated in FIG. 4A, the number of logically parallelthreads i.e. degree of parallelism is ten. Also in FIG. 4A, the numberof available physical threads is ten i.e. PT1-PT10. Thus, when tenbatches B1-10 are queued in input pipeline 204, coordinator 210concurrently processes the batches B1-B10 at the available ten physicalthreads PT1-PT10, as shown in FIG. 4B. This concurrent processing 400Boccurs because, at run-time, the coordinator determined that the countof available physical threads PT1-PT10 equaled the set number oflogically parallel threads (ten).

FIG. 5A, FIG. 5B and FIG. 5C show one implementation 500A-C ofmultiplexing batches B1-10 in a pipeline when there are fewer availablephysical threads than a set number of logically parallel threads. Inexemplary scenario 500A illustrated in FIG. 5A, a set number oflogically parallel threads i.e. parallelism is ten. However, the numberof available physical threads is only nine i.e. PT1-PT9. The unavailablephysical thread PT10 is depicted by a greyed-out box in FIG. 5A, FIG.5B, and FIG. 5C. In some implementations, unavailability refers to thatfact that an excessive or equaling thread has not even been initiated,and for such an implementation the unavailable physical thread PT10would not have been depicted in FIG. 5A, FIG. 5B, and FIG. 5C. In otherimplementations, unavailability refers to the fact that an alreadyinitiated physical thread has failed and is not capable of processingbatches, as depicted in the exemplary scenario of FIG. 5A, FIG. 5B, andFIG. 5C.

The technology disclosed adapts to this discrepancy in the availablecomputation resources PT1-PT10 and the data units B1-B10 to be processedby multiplexing the batches B1-B10 sequentially over the nine availablephysical threads PT1-PT9. Multiplexing includes concurrently processingbatches B1-B9 over the available physical threads PT1-PT9 and when oneof the batch (like B9) from batches B1-B9 completes processing by theavailable physical thread or queues at the output pipeline 218, the nextbatch B10 in the input pipeline 204 is processed at the next availablephysical thread (like PT9) by the coordinator 210, as shown in FIG. 5C.

Flowchart

FIG. 6 shows one implementation of a flowchart 600 of handling multipletask sequences including long tail task sequences on a limited number ofworker nodes of a stream processing system. Flowchart 600 can beimplemented at least partially with a computer or other data processingsystem, e.g., by one or more processors configured to receive orretrieve information, process the information, store results, andtransmit the results. Other implementations may perform the actions indifferent orders and/or with different, fewer or additional actions thanthose illustrated in FIG. 6. Multiple actions can be combined in someimplementations. For convenience, this workflow is described withreference to the system that carries out a method. The system is notnecessarily part of the method.

At action 610, the method includes defining containers over worker nodesthat have physical threads, with one physical thread utilizing a wholeprocessor core of a worker node, as described supra.

At action 620, the method includes, for multiple task sequences, queuingdata from incoming near real-time (NRT) data streams in pipelines thatrun in the containers, as described supra.

At action 630, the method includes, processing data from the NRT datastreams as batches using a container-coordinator that controls dispatchof the batches, as described supra.

At action 640, the method includes dispatching the batches to thephysical threads, where a batch runs to completion or to a time out, asdescribed supra. The method also includes during execution, comparing acount of available physical threads against a set number of logicallyparallel threads. The method further includes, when a count of availablephysical threads equals or exceeds the number of logically parallelthreads, concurrently processing the batches at the physical threads,and when there are fewer available physical threads than the number oflogically parallel threads, multiplexing the batches sequentially overthe available physical threads.

The some implementations, the disclosed method further includesconcurrently processing at least one subset of the batches in thepipeline with at least another subset of the batches in the pipeline andmultiplexing at least some of the batches in the subsets sequentially.The number of logically parallel threads is 10 and the count ofavailable physical threads is 10 in some implementations, and the methodcan further include concurrently processing the batches in the pipelineat the 10 available physical threads. In other implementations, thenumber of logically parallel threads is 10 and the count of availablephysical threads is 9. The disclosed method can further includeconcurrently processing the batches in the pipeline at 8 of the 9available physical threads and multiplexing some of the batches in thepipeline sequentially over at least 1 available physical thread.

In another implementation, the number of logically parallel threads is10 and the count of available physical threads is 1, and includesmultiplexing the batches in the pipeline sequentially over the 1available physical thread. The multiplexing can include processing abatch in a pipeline till completion or time out before processing a nextbatch in the pipeline.

In some implementations the disclosed method can further includeconcurrently processing a plurality of pipelines over multiple workernodes in a container.

A batch is defined on a time-slice basis and includes a portion of atleast one incoming NRT data stream most recently received within a timewindow, for some implementations. In others, a batch is defined on abatch-size basis and includes a data size constrained portion of atleast one incoming NRT data stream received most recently.

Multi-Tenant Integration

FIG. 7 is a block diagram of an exemplary multi-tenant system 700suitable for integration with in the IoT platform 100 of FIG. 1 inaccordance with one or more implementation.

IoT platform 100 of FIG. 1 can be implemented using a multi-tenantsystem. In that regard, FIG. 7 presents a conceptual block diagram of anexemplary multi-tenant system suitable for integration with the IoTplatform 100 of FIG. 1 in accordance with one or more implementations.

In general, the illustrated multi-tenant system 700 of FIG. 7 includes aserver 702 that dynamically creates and supports virtual applications728A and 728B based upon data 732 from a common database 730 that isshared between multiple tenants, alternatively referred to herein as a“multi-tenant database”. Data and services generated by the virtualapplications 728A and 728B are provided via a network 745 to any numberof client devices 740A or 740B, as desired. Virtual applications 728Aand 728B are suitably generated at run-time (or on-demand) usingapplication platform 710 that securely provides access to the data 732in the database 730 for each of the various tenants subscribing to themulti-tenant system 700. In accordance with one non-limiting example,the multi-tenant system 700 is implemented in the form of an on-demandmulti-tenant user relationship management (CRM) system that can supportany number of authenticated users of multiple tenants.

As used herein, a “tenant” or an “organization” refers to a group of oneor more users that shares access to common subset of the data within themulti-tenant database 730. In this regard, each tenant includes one ormore users associated with, assigned to, or otherwise belonging to thatrespective tenant. Stated another way, each respective user within themulti-tenant system 700 is associated with, assigned to, or otherwisebelongs to a particular tenant of the plurality of tenants supported bythe multi-tenant system 700. Tenants may represent users, userdepartments, work or legal organizations, and/or any other entities thatmaintain data for particular sets of users within the multi-tenantsystem 700. Although multiple tenants may share access to the server 702and the database 730, the particular data and services provided from theserver 702 to each tenant can be securely isolated from those providedto other tenants. The multi-tenant architecture therefore allowsdifferent sets of users to share functionality and hardware resourceswithout necessarily sharing any of the data 732 belonging to orotherwise associated with other tenants.

The multi-tenant database 730 is any sort of repository or other datastorage system capable of storing and managing the data 732 associatedwith any number of tenants. The database 730 may be implemented usingany type of conventional database server hardware. In variousimplementations, the database 730 shares processing hardware with theserver 702. In other implementations, the database 730 is implementedusing separate physical and/or virtual database server hardware thatcommunicates with the server 702 to perform the various functionsdescribed herein. In an exemplary implementation, the database 730includes a database management system or other equivalent softwarecapable of determining an optimal query plan for retrieving andproviding a particular subset of the data 732 to an instance of virtualapplication 728A or 728B in response to a query initiated or otherwiseprovided by a virtual application 728A or 728B. The multi-tenantdatabase 730 may alternatively be referred to herein as an on-demanddatabase, in that the multi-tenant database 730 provides (or isavailable to provide) data at run-time to on-demand virtual applications728A or 728B generated by the application platform 710.

In practice, the data 732 may be organized and formatted in any mannerto support the application platform 710. In various implementations, thedata 732 is suitably organized into a relatively small number of largedata tables to maintain a semi-amorphous “heap”-type format. The data732 can then be organized as needed for a particular virtual application728A or 728B. In various implementations, conventional datarelationships are established using any number of pivot tables 734 thatestablish indexing, uniqueness, relationships between entities, and/orother aspects of conventional database organization as desired. Furtherdata manipulation and report formatting is generally performed atrun-time using a variety of metadata constructs. Metadata within auniversal data directory (UDD) 736, for example, can be used to describeany number of forms, reports, workflows, user access privileges, worklogic and other constructs that are common to multiple tenants.Tenant-specific formatting, functions and other constructs may bemaintained as tenant-specific metadata 738A and 738B for each tenant, asdesired. Rather than forcing the data 732 into an inflexible globalstructure that is common to all tenants and applications, the database730 is organized to be relatively amorphous, with the pivot tables 734and the metadata 738A and 738B providing additional structure on anas-needed basis. To that end, the application platform 710 suitably usesthe pivot tables 734 and/or the metadata 738A-B to generate “virtual”components of the virtual applications 728A and 728B to logicallyobtain, process, and present the relatively amorphous data 732 from thedatabase 730.

The server 702 is implemented using one or more actual and/or virtualcomputing systems that collectively provide the dynamic applicationplatform 710 for generating the virtual applications 728A and 728B. Forexample, the server 702 may be implemented using a cluster of actualand/or virtual servers operating in conjunction with each other,typically in association with conventional network communications,cluster management, load balancing and other features as appropriate.The server 702 operates with any sort of conventional processinghardware such as a processor 705, memory 706, input/output features 707and the like. The input/output features 707 generally represent theinterface(s) to networks (e.g., to the network 745, or any other localarea, wide area or other network), mass storage, display devices, dataentry devices and/or the like. The processor 705 may be implementedusing any suitable processing system, such as one or more processors,controllers, microprocessors, microcontrollers, processing cores and/orother computing resources spread across any number of distributed orintegrated systems, including any number of “cloud-based” or othervirtual systems. The memory 706 represents any non-transitory short orlong term storage or other computer-readable media capable of storingprogramming instructions for execution on the processor 705, includingany sort of random access memory (RAM), read only memory (ROM), flashmemory, magnetic or optical mass storage, and/or the like. Thecomputer-executable programming instructions, when read and executed bythe server 702 and/or processor 705, cause the server 702 and/orprocessor 705 to create, generate, or otherwise facilitate theapplication platform 710 and/or virtual applications 728A and 728B, andperform one or more additional tasks, operations, functions, and/orprocesses described herein. It should be noted that the memory 706represents one suitable implementation of such computer-readable media,and alternatively or additionally, the server 702 could receive andcooperate with external computer-readable media that is realized as aportable or mobile component or application platform, e.g., a portablehard drive, a USB flash drive, an optical disc, or the like.

The application platform 710 is any sort of software application orother data processing engine that generates the virtual applications728A and 728B that provide data and/or services to the client devices740A and 740B. In a typical implementation, the application platform 710gains access to processing resources, communications interfaces andother features of the processing hardware using any sort of conventionalor proprietary operating system 708. The virtual applications 728A and728B are typically generated at run-time in response to input receivedfrom the client devices 740A and 740B. For the illustratedimplementation, the application platform 710 includes a bulk dataprocessing engine 712, a query generator 714, a search engine 716 thatprovides text indexing and other search functionality, and a runtimeapplication generator 720. Each of these features may be implemented asa separate process or other module, and many equivalent implementationscould include different and/or additional features, components or othermodules as desired.

The runtime application generator 720 dynamically builds and executesthe virtual applications 728A and 728B in response to specific requestsreceived from the client devices 740A and 740B. The virtual applications728A and 728B are typically constructed in accordance with thetenant-specific metadata 738A and 738B, which describes the particulartables, reports, interfaces and/or other features of the particularapplication 728A or 728B. In various implementations, each virtualapplication 728A or 728B generates dynamic web content that can beserved to a browser or other client programs 742A and 742B associatedwith its client device 740A or 740B, as appropriate.

The runtime application generator 720 suitably interacts with the querygenerator 714 to efficiently obtain multi-tenant data 732 from thedatabase 730 as needed in response to input queries initiated orotherwise provided by users of the client devices 740A and 740B. In atypical implementation, the query generator 714 considers the identityof the user requesting a particular function (along with the user'sassociated tenant), and then builds and executes queries to the database730 using system-wide metadata within a universal data directory (UDD)736, tenant specific metadata 738A and 738B, pivot tables 734, and/orany other available resources. The query generator 714 in this exampletherefore maintains security of the common database 730 by ensuring thatqueries are consistent with access privileges granted to the user and/ortenant that initiated the request. In this manner, the query generator714 suitably obtains requested subsets of data 732 accessible to a userand/or tenant from the database 730 as needed to populate the tables,reports or other features of the particular virtual application 728A or728B for that user and/or tenant.

Still referring to FIG. 7, the data processing engine 712 performs bulkprocessing operations on the data 732 such as uploads or downloads,updates, online transaction processing, and/or the like. In manyimplementations, less urgent bulk processing of the data 732 can bescheduled to occur as processing resources become available, therebygiving priority to more urgent data processing by the query generator714, the search engine 716, the virtual applications 728A and 728B, etc.

In exemplary implementations, the application platform 710 is utilizedto create and/or generate data-driven virtual applications 728A and 728Bfor the tenants that they support. Such virtual applications 728A and728B may make use of interface features such as custom (ortenant-specific) screens 724, standard (or universal) screens 722 or thelike. Any number of custom and/or standard objects 726 may also beavailable for integration into tenant-developed virtual applications728A and 728B. As used herein, “custom” should be understood as meaningthat a respective object or application is tenant-specific (e.g., onlyavailable to users associated with a particular tenant in themulti-tenant system) or user-specific (e.g., only available to aparticular subset of users within the multi-tenant system), whereas“standard” or “universal” applications or objects are available acrossmultiple tenants in the multi-tenant system. The data 732 associatedwith each virtual application 728A or 728B is provided to the database730, as appropriate, and stored until it is requested or is otherwiseneeded, along with the metadata 738A and 738B that describes theparticular features (e.g., reports, tables, functions, objects, fields,formulas, code, etc.) of that particular virtual application 728A or728B. For example, a virtual application 728A or 728B may include anumber of objects 726 accessible to a tenant, wherein for each object726 accessible to the tenant, information pertaining to its object typealong with values for various fields associated with that respectiveobject type are maintained as metadata 738A and 738B in the database730. In this regard, the object type defines the structure (e.g., theformatting, functions and other constructs) of each respective object726 and the various fields associated therewith.

With continued reference to FIG. 7, the data and services provided bythe server 702 can be retrieved using any sort of personal computer,mobile telephone, tablet or other network-enabled client device 740A or740B on the network 745. In an exemplary implementation, the clientdevice 740A or 740B includes a display device, such as a monitor,screen, or another conventional electronic display capable ofgraphically presenting data and/or information retrieved from themulti-tenant database 730. Typically, the user operates a conventionalbrowser application or other client program 742A or 742B executed by theclient devices 740A and 740B to contact the server 702 via the network745 using a networking protocol, such as the hypertext transportprotocol (HTTP) or the like. The user typically authenticates his or heridentity to the server 702 to obtain a session identifier (“SessionID”)that identifies the user in subsequent communications with the server702. When the identified user requests access to a virtual application728A or 728B, the runtime application generator 720 suitably creates theapplication at run time based upon the metadata 738A and 738B, asappropriate. As noted above, the virtual application 728A or 728B maycontain Java, ActiveX, or other content that can be presented usingconventional client software running on the client device 740A or 740B;other implementations may simply provide dynamic web or other contentthat can be presented and viewed by the user, as desired.

The foregoing description is merely illustrative in nature and is notintended to limit the implementations of the subject matter or theapplication and uses of such implementations. Furthermore, there is nointention to be bound by any expressed or implied theory presented inthe technical field, background, or the detailed description. As usedherein, the word “exemplary” means “serving as an example, instance, orillustration.” Any implementation described herein as exemplary is notnecessarily to be construed as preferred or advantageous over otherimplementations, and the exemplary implementations described herein arenot intended to limit the scope or applicability of the subject matterin any way.

For the sake of brevity, conventional techniques related to databases,social networks, user interfaces, and other functional aspects of thesystems (and the individual operating components of the systems) may notbe described in detail herein. In addition, those skilled in the artwill appreciate that implementations may be practiced in conjunctionwith any number of system and/or network architectures, datatransmission protocols, and device configurations, and that the systemdescribed herein is merely one suitable example. Furthermore, certainterminology may be used herein for the purpose of reference only, andthus is not intended to be limiting. For example, the terms “first”,“second” and other such numerical terms do not imply a sequence or orderunless clearly indicated by the context.

Implementations of the subject matter may be described herein in termsof functional and/or logical block components, and with reference tosymbolic representations of operations, processing tasks, and functionsthat may be performed by various computing components or devices. Suchoperations, tasks, and functions are sometimes referred to as beingcomputer-executed, computerized, software-implemented, orcomputer-implemented. In practice, one or more processing systems ordevices can carry out the described operations, tasks, and functions bymanipulating electrical signals representing data bits at accessiblememory locations, as well as other processing of signals. The memorylocations where data bits are maintained are physical locations thathave particular electrical, magnetic, optical, or organic propertiescorresponding to the data bits. It should be appreciated that thevarious block components shown in the figures may be realized by anynumber of hardware, software, and/or firmware components configured toperform the specified functions. For example, an implementation of asystem or a component may employ various integrated circuit components,e.g., memory elements, digital signal processing elements, logicelements, look-up tables, or the like, which may carry out a variety offunctions under the control of one or more microprocessors or othercontrol devices. When implemented in software or firmware, variouselements of the systems described herein are essentially the codesegments or instructions that perform the various tasks. The program orcode segments can be stored in a processor-readable medium ortransmitted by a computer data signal embodied in a carrier wave over atransmission medium or communication path. The “processor-readablemedium” or “machine-readable medium” may include any non-transitorymedium that can store or transfer information. Examples of theprocessor-readable medium include an electronic circuit, a semiconductormemory device, a ROM, a flash memory, an erasable ROM (EROM), a floppydiskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium,a radio frequency (RF) link, or the like. The computer data signal mayinclude any signal that can propagate over a transmission medium such aselectronic network channels, optical fibers, air, electromagnetic paths,or RF links. The code segments may be downloaded via computer networkssuch as the Internet, an intranet, a LAN, or the like. In this regard,the subject matter described herein can be implemented in the context ofany computer-implemented system and/or in connection with two or moreseparate and distinct computer-implemented systems that cooperate andcommunicate with one another. In one or more exemplary implementations,the subject matter described herein is implemented in conjunction with avirtual user relationship management (CRM) application in a multi-tenantenvironment.

Some Particular Implementations

Some particular implementations and features are described in thefollowing discussion.

The technology disclosed monitors performance of the IoT platform 100and its components, and also maintains application metrics for the IoTplatform 100. In one implementation, the technology disclosed calculatesthroughput and latency of a container and/or a topology. In anotherimplementation, the technology disclosed calculates tuples per minute,capacity, throughput, latency, queuing time, read and write rates andexecution time for each spout and bolt within a container and/or atopology. In yet another implementation, the technology disclosedcalculates an offset between an input queue (e.g. Kafka spout) and anoutput queue (e.g. Kafka sink) of a container, and determines a latencyand/or a drop in throughput within the container.

In some implementations, one or more monitoring tools are used to detectlatency and throughput variations within a container. Some examples ofsuch monitoring tools include data collectors like Storm UI, JMX (Javamanagement extensions), VisualVM, Yammer metrics, Statsd, Graphite,Log4j, Ganglia and Nagios. In one implementation, tuple trackers areused to track the tuples emitted, acked and failed at different spoutsand bolts within a topology. Tuple trackers are libraries of programmingcode written in a programming language like Java or JSON that areattached to individual topology components to provide periodic updateson the processing of tuples at the respective components.

In one implementation, an offset monitor is used that monitors Kafkaqueue consumers and their current offset. This offset monitor identifiesthe current consumer groups, the topics being consumed within eachconsumer group and the offsets of the consumer groups in each Kafkaqueue. This information is used to calculate the rate at which tuplesare consumed by the input queue.

In yet another implementation, certain application metrics for a Kafkainput queue are monitored. In one example, offset commit rate of Kafkaconsumers to a service registry like ZooKeeper is tracked to determine atuple consumption rate. In another example, the offset cache size ofKafka brokers is tracked to determine the tuple consumption rate. In afurther implementation, when a Kafka spout commits an offset to aZooKeeper, the latest offset from the Kafka broker is read and comparedwith the offset at the ZooKeeper. This comparison yields a delta that isused to calculate the tuple consumption rate of the container. In oneother implementation, various application metrics are determined for aKafka spout, including spout lag, latest time offset, latest emittedoffset and earliest time offset, and used to determine the tupleconsumption rate.

Further, a long tail task sequence is detected when the tupleconsumption rate at an input queue drops below a preset consumptionrate, according to one implementation. In another implementation, a longtail task sequence is detected when the emission rate at a Kafka spoutdrops below a preset emission rate. In yet other implementations,different monitoring tools and application metrics described supra canbe used to detect a long tail task sequence.

Further, a surging task sequence is detected when the tuple consumptionrate at an input queue exceeds a preset consumption rate, according toone implementation. In another implementation, a surging task sequenceis detected when the emission rate at a Kafka spout exceeds a presetemission rate. In yet other implementations, different monitoring toolsand application metrics described supra can be used to detect a surgingtask sequence.

In one implementation, a method of handling multiple task sequencesincluding long tail task sequences on a limited number of worker nodesof a stream processing system includes defining containers over workernodes that have physical threads, with one physical thread utilizing awhole processor core of a worker node. The method also includes, formultiple task sequences, queuing data from incoming near real-time (NRT)data streams in pipelines that run in the containers, processing datafrom the NRT data streams as batches using a container-coordinator thatcontrols dispatch of the batches, and dispatching the batches to thephysical threads, where a batch runs to completion or to a time out,including during execution, comparing a count of available physicalthreads against a set number of logically parallel threads. The methodfurther includes, when a count of available physical threads equals orexceeds the number of logically parallel threads, concurrentlyprocessing the batches at the physical threads, and when there are feweravailable physical threads than the number of logically parallelthreads, multiplexing the batches sequentially over the availablephysical threads.

The some implementations, the disclosed method further includesconcurrently processing at least one subset of the batches in thepipeline with at least another subset of the batches in the pipeline andmultiplexing at least some of the batches in the subsets sequentially.The number of logically parallel threads is 10 and the count ofavailable physical threads is 10 in some implementations, and the methodcan further include concurrently processing the batches in the pipelineat the 10 available physical threads. In other implementations, thenumber of logically parallel threads is 10 and the count of availablephysical threads is 9. The disclosed method can further includeconcurrently processing the batches in the pipeline at 8 of the 9available physical threads and multiplexing some of the batches in thepipeline sequentially over at least 1 available physical thread.

In another implementation, the number of logically parallel threads is10 and the count of available physical threads is 1, and includesmultiplexing the batches in the pipeline sequentially over the 1available physical thread. The multiplexing can include processing abatch in a pipeline till completion or time out before processing a nextbatch in the pipeline.

In some implementations the disclosed method can further includeconcurrently processing a plurality of pipelines over multiple workernodes in a container, including when there are fewer available physicalthreads than the number of logically parallel threads, multiplexing thepipelines sequentially over the available physical threads.

A batch is defined on a time-slice basis and includes a portion of atleast one incoming NRT data stream most recently received within a timewindow, for some implementations. In other implementations, a batch isdefined on a batch-size basis and includes a data size constrainedportion of at least one incoming NRT data stream received most recently.

The implementations and features described in this section and othersections of the technology disclosed can include one or more of thefollowing features and/or features described in connection withadditional methods disclosed. In the interest of conciseness, thecombinations of features disclosed in this application are notindividually enumerated and are not repeated with each base set offeatures. The reader will understand how features identified in thismethod can readily be combined with sets of base features identified asimplementations such as terminology, introduction, IoT platform andstream-batch processing framework, state machine, data columnar,flowcharts, multi-tenant integration, some particular implementations,etc.

Other implementations of the method described in this section caninclude a non-transitory computer readable storage medium storingcomputer program instructions executable by a processor to perform anyof the methods described above. Yet another implementation of the methoddescribed in this section can include a system including one or moreprocessors coupled to memory, the memory loaded with computerinstructions, operable to execute instructions, stored in the memory, toperform any of the methods described above.

The terms and expressions employed herein are used as terms andexpressions of description and not of limitation, and there is nointention, in the use of such terms and expressions, of excluding anyequivalents of the features shown and described or portions thereof. Inaddition, having described certain implementations of the technologydisclosed, it will be apparent to those of ordinary skill in the artthat other implementations incorporating the concepts disclosed hereincan be used without departing from the spirit and scope of thetechnology disclosed. Accordingly, the described implementations are tobe considered in all respects as only illustrative and not restrictive.

What is claimed is:
 1. A method of handling multiple task sequences,including long tail task sequences, the method comprising: defining acontainer over worker nodes having up to one physical thread perprocessor core of a worker node; for multiple task sequences, queuingdata from a plurality of incoming near real-time (NRT) data streams inat least one pipeline running in the container; determining, based onanalysis of a given NRT data stream for processing by at least one tasksequence of the multiple task sequences, that a data volume for the atleast one task sequence is expected to decrease after a surge in thedata volume; processing data from the plurality of NRT data streams in aplurality of batches via a container-coordinator configured to controlbatch dispatching; dispatching the plurality of batches to physicalthreads of the worker nodes for processing, wherein the dispatchingcomprises: during execution, comparing a count of physical threadsavailable for batch processing against a set number of logicallyparallel threads available for batch dispatching; when a count of thephysical threads available for batch processing equals or exceeds thenumber of logically parallel threads available for batch dispatching,concurrently processing the plurality of batches at the physicalthreads; and when the count of physical threads available for batchprocessing is less than the number of logically parallel threadsavailable for batch dispatching, multiplexing the plurality of batchessequentially over at least one of the physical threads available forbatch processing, including processing a batch of the plurality ofbatches in the at least one pipeline till completion or time out beforeprocessing a next batch of the plurality of batches in the at least onepipeline; and assigning, via a scheduler, a priority level to at least afirst pipeline and a second pipeline, wherein execution of a firstnumber of batches of the plurality of batches in the first pipeline isperformed before execution of a second number of batches of theplurality of batches in the second pipeline, according to the prioritylevel.
 2. The method of claim 1, further including concurrentlyprocessing at least one subset of the plurality of batches in the atleast one pipeline with at least another subset of the plurality ofbatches in the at least one pipeline and multiplexing at least one batchin the subsets sequentially.
 3. The method of claim 1, further includingconcurrently processing a plurality of pipelines over multiple workernodes in a given container, including: when there are fewer physicalthreads available for batch processing than the number of logicallyparallel threads available for batch dispatching, multiplexing theplurality of pipelines sequentially over the available physical threads.4. The method of claim 1, wherein at least one batch is defined on atime-slice basis and includes a portion of at least one incoming NRTdata stream most recently received within a time window.
 5. The methodof claim 1, wherein at least one batch is defined on a batch-size basis.6. The method of claim 1, wherein the at least one pipeline comprises aplurality of grouped event tuples from a portion of at least oneincoming NRT data stream.
 7. A system for handling multiple tasksequences including long-tail task sequences, the system including oneor more processors coupled to memory and configured to performoperations comprising: defining a container over worker nodes having upto one physical thread per processor core of a worker node; for multipletask sequences, queuing data from a plurality of incoming near real-time(NRT) data streams in at least one pipeline running in the container;determining, based on analysis of a given NRT data stream for processingby at least one task sequence of the multiple task sequences, that adata volume for the at least one task sequence is expected to decreaseafter a surge in the data volume; processing data from the plurality ofNRT data streams in a plurality of batches via a container-coordinatorconfigured to control batch dispatching; dispatching the plurality ofbatches to physical threads of the worker nodes for processing, whereinthe dispatching comprises: during execution, comparing a count ofphysical threads available for batch processing against a set number oflogically parallel threads available for batch dispatching; when a countof the physical threads available for batch processing equals or exceedsthe number of logically parallel threads available for batchdispatching, concurrently processing the plurality of batches at thephysical threads; and when the count of physical threads available forbatch processing is less than the number of logically parallel threadsavailable for batch dispatching, multiplexing the plurality of batchessequentially over at least one of the physical threads available forbatch processing, including processing a batch of the plurality ofbatches in the at least one pipeline till completion or time out beforeprocessing a next batch of the plurality of batches in the at least onepipeline; and assigning, via a scheduler, a priority level to at least afirst pipeline and a second pipeline, wherein execution of a firstnumber of batches of the plurality of batches in the first pipeline isperformed before execution of a second number of batches of theplurality of batches in the second pipeline, according to the prioritylevel.
 8. The system of claim 7, configured to perform operationscomprising concurrently processing at least one subset of the pluralityof batches in the at least one pipeline with at least another subset ofthe plurality of batches in the at least one pipeline and multiplexingat least one batch in the subsets sequentially.
 9. The system of claim7, further configured to perform operations comprising concurrentlyprocessing a plurality of pipelines over multiple worker nodes in agiven container, including: when there are fewer available physicalthreads than the number of logically parallel threads, multiplexing theplurality of pipelines sequentially over the available physical threads.10. The system of claim 7, wherein at least one batch is defined on atime-slice basis and includes a portion of at least one incoming NRTdata stream most recently received within a time window.
 11. The systemof claim 7, wherein at least one batch is defined on a batch-size basis.12. The system of claim 7, wherein the at least one pipeline comprises aplurality of grouped event tuples from a portion of at least oneincoming NRT data stream.
 13. A non-transitory computer-readable storagemedium with computer program instructions stored thereon for handlingmultiple task sequences including long-tail task sequences, wherein theinstructions, when executed by at least one processor, cause the atleast one processor to perform operations comprising: defining acontainer over worker nodes having up to one physical thread perprocessor core of a worker node; for multiple task sequences, queuingdata from a plurality of incoming near real-time (NRT) data streams inat least one pipeline running in the container; determining, based onanalysis of a given NRT data stream for processing by at least one tasksequence of the multiple task sequences, that a data volume for the atleast one task sequence is expected to decrease after a surge in thedata volume; processing data from the plurality of NRT data streams in aplurality of batches via a container-coordinator configured to controlbatch dispatching; dispatching the plurality of batches to physicalthreads of the worker nodes for processing, wherein the dispatchingcomprises: during execution, comparing a count of physical threadsavailable for batch processing against a set number of logicallyparallel threads available for batch dispatching; when a count of thephysical threads available for batch processing equals or exceeds thenumber of logically parallel threads available for batch dispatching,concurrently processing the plurality of batches at the physicalthreads; and when the count of physical threads available for batchprocessing is less than the number of logically parallel threadsavailable for batch dispatching, multiplexing the plurality of batchessequentially over at least one of the physical threads available forbatch processing, including processing a batch of the plurality ofbatches in the at least one pipeline till completion or time out beforeprocessing a next batch of the plurality of batches in the at least onepipeline; and assigning, via a scheduler, a priority level to at least afirst pipeline and a second pipeline, wherein execution of a firstnumber of batches of the plurality of batches in the first pipeline isperformed before execution of a second number of batches of theplurality of batches in the second pipeline, according to the prioritylevel.
 14. The non-transitory computer-readable storage medium of claim13, the operations further comprising concurrently processing at leastone subset of the plurality of batches in the at least one pipeline withat least another subset of the plurality of batches in the at least onepipeline and multiplexing at least one batch in the subsetssequentially.
 15. The non-transitory computer-readable storage medium ofclaim 13, the operations further comprising concurrently processing aplurality of pipelines over multiple worker nodes in a given container,including: when there are fewer available physical threads than thenumber of logically parallel threads, multiplexing the plurality ofpipelines sequentially over the available physical threads.
 16. Thenon-transitory computer-readable storage medium of claim 13, wherein atleast one batch is defined on a time-slice basis and includes a portionof at least one incoming NRT data stream most recently received within atime window.
 17. The non-transitory computer-readable storage medium ofclaim 13, wherein at least one batch is defined on a batch-size basis.